<?php do_action( 'bp_before_profile_loop_content' ); ?>

<?php if ( bp_has_profile() ) : ?>

	<?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>

		<?php if ( bp_profile_group_has_fields() ) : ?>

			<?php do_action( 'bp_before_profile_field_content' ); ?>

			<div class="bp-widget <?php bp_the_profile_group_slug(); ?>">

<div class="profile_fields">
	<h3 id="profile_field_name">Username: <?php bp_displayed_user_username();?></h3>
	<p id="profile_field_age">Age <?php bp_profile_field_data( 'field=Age' );?></p>
	<p id="profile_field_gender"><?php bp_profile_field_data( 'field=Gender' );?></p>
</div>
				<table class="profile-fields">

					<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>

						<?php if ( bp_field_has_data() ) : 
						
							//Skip the fields: Name, Age, Gender. These have already been taken care of
							if( bp_get_the_profile_field_name() == 'Name' || bp_get_the_profile_field_name() == 'Age' || bp_get_the_profile_field_name() == 'Gender' ) 
								continue; ?>
							
							<tr<?php bp_field_css_class(); ?>>

								<td class="label" id="profile_label"><?php bp_the_profile_field_name(); ?></td>
								
								<?php global $field;
								$val = $field->data->value; ?>
								<td class="data" id="profile_data"><?php echo $val; ?></td>

							</tr>

						<?php endif; ?>

						<?php do_action( 'bp_profile_field_item' ); ?>

					<?php endwhile; ?>

				</table>
			</div>

			<?php do_action( 'bp_after_profile_field_content' ); ?>

		<?php endif; ?>

	<?php endwhile; ?>

	<?php do_action( 'bp_profile_field_buttons' ); ?>

<?php endif; ?>

<?php do_action( 'bp_after_profile_loop_content' ); ?>
